{extend name="layout" /}
{block name="content"}
<div class="mui-content">
   <!--  <div class="header-btns uk-margin-small-top">
        <div class="tm-content tm-bg-white">
            <div class="tm-label">
                <a class="mui-btn radiu-green btn-radiu" href="">
                    奖励金
                </a>
            </div>
        </div>
    </div> -->
    <div class="tm-df-size uk-margin-small-top">
        <ul class="mui-table-view max">
            <li class="mui-table-view-cell">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            客户姓名
                        </span>
                    </div>
                    <div class="tm-icon-item">
                        <div class="tm-icon-label">
                            <span class="tm-font-gray">
                                {$cinfo.name}
                            </span>
                        </div>
                    </div>
                </div>
            </li>
            {eq name="$cinfo.kind" value="gouche"}
            <li class="mui-table-view-cell">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            意向产品
                        </span>
                    </div>
                    <div class="tm-icon-item">
                        <div class="tm-icon-label">
                            <span class="tm-font-gray">
                                {$cinfo.product}
                            </span>
                        </div>
                    </div>
                </div>
            </li>
            {/eq}
            <li class="mui-table-view-cell">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            获取时间
                        </span>
                    </div>
                    <div class="tm-icon-item">
                        <div class="tm-icon-label">
                            <span class="tm-font-gray">
                                {$cinfo.getdate}
                            </span>
                        </div>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            地址
                        </span>
                    </div>
                    <div class="tm-icon-item">
                        <div class="tm-icon-label">
                            <span class="tm-font-gray">
                               {$cinfo.home}
                            </span>
                        </div>
                    </div>
                </div>
            </li>
        </ul>
    </div>
    <form id="formid">
        <div class="uk-margin-small-top tm-bg-white">
            <div class="tm-flex flex-align-center">
                <label class="label-padd tm-font-bold">
                    请选择申诉类型
                </label>
                <div class="tm-flex-1">
                    <div class="tm-select-item">
                        <div class="select-arrow">
                        </div>
                        <select name="typeid">
                            <option value="">请选择</option>
                            {volist name=":config('SHENSU_TYPE')" id="v"}
                            <option value="{$key}">{$v}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <ul class="mui-table-view max">
            <li class="mui-table-view-cell">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            联系人
                        </span>
                    </div>
                    <div class="tm-icon-item">
                        <div class="tm-icon-label">
                            <input class="tm-font-gray" type="text" name="linkman" value="" style="width: 200px;height: 30px;border: none;text-align: right;">
                        </div>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell">
                <div class="tm-cell-pad">
                    <div class="tm-flex flex-align-center">
                        <div class="tm-flex-1">
                            <span class="tm-font-bold">联系电话</span>
                        </div>
                        <div class="tm-icon-item">
                            <div class="tm-icon-label">
                                <!-- <span class="tm-font-gray"></span> -->
                                <input class="tm-font-gray" onkeyup = "value=value.replace(/[^\d]/g,'')" type="tel" name="linkphone" value="" style="width: 200px;height: 30px;border: none;text-align: right;">
                            </div>
                        </div>
                    </div>
                </div>
            </li>
             <li class="mui-table-view-cell upload_file" coco_upload ajax-url="/v2/accessory/upload_acce"  ajax-callback="coco_suc" ajax-data="{}">
                <div class="tm-flex flex-align-center tm-inline-2-0">
                    <div class="tm-flex-1">
                        <span class="tm-font-bold">
                            图片上传
                        </span>
                    </div>
                    <div class="tm-icon-item" id="images">
                        
                    </div>
                </div>
            </li>
            
        </ul>

        <div class="uk-margin-small-top">
            <textarea class="tm-textarea padd" placeholder="请输入申诉内容" name="content"></textarea>
            <input type="hidden" name="clientid" value="{$cinfo.id}">
        </div>
        <div id="acce" style="display: none;">
            
        </div>
        <div class="uk-margin-large-top uk-text-center">
            <button class="mui-btn mui-btn-green btn-radiu-large pay-btn cocoPostFormAjax" formid="formid" ajaxurl="{:url('v2/client/add_compt')}" type="button" style="margin-top: -20px;width: 90%; height: 45px;" ajax-callback="suc_back">
                提交
            </button>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    function coco_suc(obj, data) {
        if (data == '') {
            return false;
        }
        var html = '<div class="tm-atav tm-flex-head"><div class="tm-location-parent" style="width: 40px;"><div class="tm-location-img" style="background-image: url('+data.url+');"></div><img class="redundant-img" src="{$images_path}px-1.png" alt="" width="100"></div></div>';

        $("#images").append(html);
        $("#acce").append('<input type="hidden" value="'+data.id+'" name="acce[]" />');
    }
    function suc_back(obj, data) {
        coco_msg('提交成功');
        setTimeout(function() {
            wx.miniProgram.navigateBack();
        }, 500);
    }
</script>
{/block}
